//
//  CostomCell.m
//  ChuanNews
//
//  Created by dllo on 16/4/21.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "CostomCell.h"
#import "BaseHeader.h"
@implementation CostomCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.imgView = [[UIImageView alloc]init];
        [self.contentView addSubview:self.imgView];
        
        self.titleLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.titleLabel];
        
        self.digestLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.digestLabel];
        self.digestLabel.numberOfLines = 0;
        [self.digestLabel sizeToFit];
        
        [self jxl_setDayMode:^(UIView *view) {
            CostomCell *cell = (CostomCell *)view;
            cell.backgroundColor = [UIColor whiteColor];
            cell.contentView.backgroundColor = [UIColor whiteColor];
            cell.titleLabel.backgroundColor = [UIColor whiteColor];
            cell.titleLabel.textColor = [UIColor blackColor];
            cell.digestLabel.backgroundColor = [UIColor whiteColor];
            cell.digestLabel.textColor = [UIColor blackColor];
        } nightMode:^(UIView *view) {
            CostomCell *cell = (CostomCell *)view;
            cell.backgroundColor = [UIColor blackColor];
            cell.contentView.backgroundColor = [UIColor blackColor];
            cell.titleLabel.backgroundColor = [UIColor blackColor];
            cell.titleLabel.textColor = [UIColor whiteColor];
            cell.digestLabel.backgroundColor = [UIColor blackColor];
            cell.digestLabel.textColor = [UIColor whiteColor];        }];

    }
    return self;
}

-(void)layoutSubviews{
    [super layoutSubviews];
    self.imgView.frame = CGRectMake(5, 10, 120, 100);
    self.titleLabel.frame = CGRectMake(135, 15, WIDTH - 140, 25);
    self.digestLabel.frame = CGRectMake(135, 40, WIDTH - 140, 60);
}

-(void)dealloc{
    [_imgView release];
    [_titleLabel release];
    [_digestLabel release];
    [super dealloc];
}






/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
